home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 April: Mac OS SDK / Dev.CD Apr 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / PInterfaces / PictUtils.p < prev    next >
Encoding:
Text File  |  1995-07-06  |  6.0 KB  |  179 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        PictUtils.p
  3.  
  4.      Contains:    Picture Utilities Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. }
  19.  
  20. {$IFC UNDEFINED UsingIncludes}
  21. {$SETC UsingIncludes := 0}
  22. {$ENDC}
  23.  
  24. {$IFC NOT UsingIncludes}
  25.  UNIT PictUtils;
  26.  INTERFACE
  27. {$ENDC}
  28.  
  29. {$IFC UNDEFINED __PICTUTILS__}
  30. {$SETC __PICTUTILS__ := 1}
  31.  
  32. {$I+}
  33. {$SETC PictUtilsIncludes := UsingIncludes}
  34. {$SETC UsingIncludes := 1}
  35.  
  36.  
  37. {$IFC UNDEFINED __TYPES__}
  38. {$I Types.p}
  39. {$ENDC}
  40. {    ConditionalMacros.p                                            }
  41.  
  42. {$IFC UNDEFINED __WINDOWS__}
  43. {$I Windows.p}
  44. {$ENDC}
  45. {    Memory.p                                                    }
  46. {        MixedMode.p                                                }
  47. {    Quickdraw.p                                                    }
  48. {        QuickdrawText.p                                            }
  49. {    Events.p                                                    }
  50. {        OSUtils.p                                                }
  51. {    Controls.p                                                    }
  52. {        Menus.p                                                    }
  53.  
  54. {$IFC UNDEFINED __PALETTES__}
  55. {$I Palettes.p}
  56. {$ENDC}
  57.  
  58. {$PUSH}
  59. {$ALIGN MAC68K}
  60. {$LibExport+}
  61.  
  62. CONST
  63.     returnColorTable            = $0001;
  64.     returnPalette                = $0002;
  65.     recordComments                = $0004;
  66.     recordFontInfo                = $0008;
  67.     suppressBlackAndWhite        = $0010;
  68.  
  69. { color pick methods }
  70.     systemMethod                = 0;                            { system color pick method }
  71.     popularMethod                = 1;                            { method that chooses the most popular set of colors }
  72.     medianMethod                = 2;                            { method that chooses a good average mix of colors }
  73. { color bank types }
  74.     ColorBankIsCustom            = -1;
  75.     ColorBankIsExactAnd555        = 0;
  76.     ColorBankIs555                = 1;
  77.  
  78.     
  79. TYPE
  80.     PictInfoID = LONGINT;
  81.  
  82.     CommentSpec = RECORD
  83.         count:                    INTEGER;                                { number of occurrances of this comment ID }
  84.         ID:                        INTEGER;                                { ID for the comment in the picture }
  85.     END;
  86.  
  87.     CommentSpecPtr = ^CommentSpec;
  88.     CommentSpecHandle = ^CommentSpecPtr;
  89.  
  90.     FontSpec = RECORD
  91.         pictFontID:                INTEGER;                                { ID of the font in the picture }
  92.         sysFontID:                INTEGER;                                { ID of the same font in the current system file }
  93.         size:                    ARRAY [0..3] OF LONGINT;                { bit array of all the sizes found (1..127) (bit 0 means > 127) }
  94.         style:                    INTEGER;                                { combined style of all occurrances of the font }
  95.         nameOffset:                LONGINT;                                { offset into the fontNamesHdl handle for the font’s name }
  96.     END;
  97.  
  98.     FontSpecPtr = ^FontSpec;
  99.     FontSpecHandle = ^FontSpecPtr;
  100.  
  101.     PictInfo = RECORD
  102.         version:                INTEGER;                                { this is always zero, for now }
  103.         uniqueColors:            LONGINT;                                { the number of actual colors in the picture(s)/pixmap(s) }
  104.         thePalette:                PaletteHandle;                            { handle to the palette information }
  105.         theColorTable:            CTabHandle;                                { handle to the color table }
  106.         hRes:                    Fixed;                                    { maximum horizontal resolution for all the pixmaps }
  107.         vRes:                    Fixed;                                    { maximum vertical resolution for all the pixmaps }
  108.         depth:                    INTEGER;                                { maximum depth for all the pixmaps (in the picture) }
  109.         sourceRect:                Rect;                                    { the picture frame rectangle (this contains the entire picture) }
  110.         textCount:                LONGINT;                                { total number of text strings in the picture }
  111.         lineCount:                LONGINT;                                { total number of lines in the picture }
  112.         rectCount:                LONGINT;                                { total number of rectangles in the picture }
  113.         rRectCount:                LONGINT;                                { total number of round rectangles in the picture }
  114.         ovalCount:                LONGINT;                                { total number of ovals in the picture }
  115.         arcCount:                LONGINT;                                { total number of arcs in the picture }
  116.         polyCount:                LONGINT;                                { total number of polygons in the picture }
  117.         regionCount:            LONGINT;                                { total number of regions in the picture }
  118.         bitMapCount:            LONGINT;                                { total number of bitmaps in the picture }
  119.         pixMapCount:            LONGINT;                                { total number of pixmaps in the picture }
  120.         commentCount:            LONGINT;                                { total number of comments in the picture }
  121.         uniqueComments:            LONGINT;                                { the number of unique comments in the picture }
  122.         commentHandle:            CommentSpecHandle;                        { handle to all the comment information }
  123.         uniqueFonts:            LONGINT;                                { the number of unique fonts in the picture }
  124.         fontHandle:                FontSpecHandle;                            { handle to the FontSpec information }
  125.         fontNamesHandle:        Handle;                                    { handle to the font names }
  126.         reserved1:                LONGINT;
  127.         reserved2:                LONGINT;
  128.     END;
  129.  
  130.     PictInfoPtr = ^PictInfo;
  131.     PictInfoHandle = ^PictInfoPtr;
  132.  
  133.  
  134. FUNCTION GetPictInfo(thePictHandle: PicHandle; VAR thePictInfo: PictInfo; verb: INTEGER; colorsRequested: INTEGER; colorPickMethod: INTEGER; version: INTEGER): OSErr;
  135.     {$IFC NOT GENERATINGCFM}
  136.     INLINE $303C, $0800, $A831;
  137.     {$ENDC}
  138. FUNCTION GetPixMapInfo(thePixMapHandle: PixMapHandle; VAR thePictInfo: PictInfo; verb: INTEGER; colorsRequested: INTEGER; colorPickMethod: INTEGER; version: INTEGER): OSErr;
  139.     {$IFC NOT GENERATINGCFM}
  140.     INLINE $303C, $0801, $A831;
  141.     {$ENDC}
  142. FUNCTION NewPictInfo(VAR thePictInfoID: PictInfoID; verb: INTEGER; colorsRequested: INTEGER; colorPickMethod: INTEGER; version: INTEGER): OSErr;
  143.     {$IFC NOT GENERATINGCFM}
  144.     INLINE $303C, $0602, $A831;
  145.     {$ENDC}
  146. FUNCTION RecordPictInfo(thePictInfoID: PictInfoID; thePictHandle: PicHandle): OSErr;
  147.     {$IFC NOT GENERATINGCFM}
  148.     INLINE $303C, $0403, $A831;
  149.     {$ENDC}
  150. FUNCTION RecordPixMapInfo(thePictInfoID: PictInfoID; thePixMapHandle: PixMapHandle): OSErr;
  151.     {$IFC NOT GENERATINGCFM}
  152.     INLINE $303C, $0404, $A831;
  153.     {$ENDC}
  154. FUNCTION RetrievePictInfo(thePictInfoID: PictInfoID; VAR thePictInfo: PictInfo; colorsRequested: INTEGER): OSErr;
  155.     {$IFC NOT GENERATINGCFM}
  156.     INLINE $303C, $0505, $A831;
  157.     {$ENDC}
  158. FUNCTION DisposePictInfo(thePictInfoID: PictInfoID): OSErr;
  159.     {$IFC NOT GENERATINGCFM}
  160.     INLINE $303C, $0206, $A831;
  161.     {$ENDC}
  162. {$IFC OLDROUTINENAMES }
  163. FUNCTION DisposPictInfo(thePictInfoID: PictInfoID): OSErr;
  164.     {$IFC NOT GENERATINGCFM}
  165.     INLINE $303C, $0206, $A831;
  166.     {$ENDC}
  167. {$ENDC}
  168.  
  169. {$ALIGN RESET}
  170. {$POP}
  171.  
  172. {$SETC UsingIncludes := PictUtilsIncludes}
  173.  
  174. {$ENDC} {__PICTUTILS__}
  175.  
  176. {$IFC NOT UsingIncludes}
  177.  END.
  178. {$ENDC}
  179.